package com.flyduck.system.vo.menu.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysMenuEntity;
import com.flyduck.system.vo.menu.SysMenuTreeRespVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysMenuEntityToSysMenuTreeRespVO implements Function<SysMenuEntity, SysMenuTreeRespVO> {

    @Override
    public SysMenuTreeRespVO apply(SysMenuEntity sysMenuEntity) {
        SysMenuTreeRespVO sysMenuTreeRespVO = new SysMenuTreeRespVO();
        BeanUtil.copyProperties(sysMenuEntity,sysMenuTreeRespVO);
        sysMenuTreeRespVO.setId(sysMenuEntity.getId()+"");
        sysMenuTreeRespVO.setParentId(sysMenuEntity.getParentId()+"");
        sysMenuTreeRespVO.setSort(sysMenuEntity.getSort()+"");
        return sysMenuTreeRespVO;
    }
}
